home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
desksamp.zip
/
DESKTOP.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1980-01-01
|
15KB
|
576 lines
Program KevinDesktop(Input,output);
uses Crt,Dos;
const
days : array [0..6] of String[9] =
('Sunday','Monday','Tuesday',
'Wednesday','Thursday','Friday',
'Saturday');
var
year,month,day,dayofweek,hour,minute,second,splitsecond: Word; {Time Tracker}
option: char; {selection of what application}
quit: boolean; {allows quiting}
Schedule: Array[1..17] of String; {schedule array}
Data:Array[1..50,1..4] of String; {database array}
Curpointer: integer; {cursor pointer}
curoption: string; {string containing current option}
Procedure disptitle; {procedure for title window}
begin
gotoxy(1,1);
write('╔═══════Title════════════╗');
gotoxy(1,2);
write('║Automagic DESKTOP SYTEMS║');
gotoxy(1,3);
write('║To complete all computer║');
gotoxy(1,4);
write('║ needs ║'); {puts title on screen}
gotoxy(1,5);
write('║ by Kevin Hellman ║');
gotoxy(1,6);
write('║ (C)opyright VGA tm ║');
gotoxy(1,7);
write('╚════════════════════════╝');
end; {disptitle}
Procedure dispstatbox; {this procedure makes the statbox}
begin
gotoxy(27,1);
write('╔══════════════════Stat═Box═════════════════════════╗');
gotoxy(27,2);
write('║',diskfree(3),' bytes free on drive c:'); {display bytes free}
gotoxy(79,2);
write('║');
getdate(year,month,day,dayofweek);
gotoxy(27,3);
write('║ Date:', days[dayofweek],', ',month:0, '/', day:0, '/', year:0);
gotoxy(79,3);
write('║');
gotoxy(27,4);
gettime(hour,minute,second,splitsecond);
write('║ Time:',hour,':',minute,':',second);
gotoxy(79,4);
write('║');
gotoxy(27,5);
write('╠═════════════Current═Application═══════════════════╣');
gotoxy(27,6);
write('║ ',curoption);
gotoxy(79,6);
write('║');
gotoxy(27,7);
write('╚═══════════════════════════════════════════════════╝');
end; {dispstatbox}
Procedure initialize; {this is the intro screen}
begin
curoption:='none';
curpointer:=0;
quit:=false;
clrscr;
disptitle;
dispstatbox;
delay(5000);
clrscr;
end; {disp intialize}
procedure MainMenu; {the main menu}
begin
gotoxy(1,1);
write('╔═══════Menu═════════════╗');
gotoxy(1,2);
write('║1__Shell/File Runner ║');
gotoxy(1,3);
write('║2__Schedule ║');
gotoxy(1,4);
write('║3__Data Base ║'); {puts title on screen}
gotoxy(1,5);
write('║4__Word proccesor ║');
gotoxy(1,6);
write('║ ENTER OPTION NUMBER ║');
gotoxy(1,7);
write('╚════════════════════════╝');
option:='0';
while (option<'1') or (option>'4') do
begin
sound(100);
delay(100);
nosound;
gotoxy(1,8);
readln(option);
gotoxy(1,8);
writeln;
end;
end; {main menu}
Procedure FileRunnermenu; {the file runner menu}
begin
gotoxy(1,1);
write('╔═══════Menu═════════════╗');
gotoxy(1,2);
write('║1__Run A Program ║');
gotoxy(1,3);
write('║2__Display a file ║');
gotoxy(1,4);
write('║3__Change Path ║');
gotoxy(1,5);
write('║ ║');
gotoxy(1,6);
write('║4__Return to main ║');
gotoxy(1,7);
write('╚════════════════════════╝');
option:='0';
while (option<'1') or (option>'4') do
begin
sound(100);
delay(100);
nosound;
gotoxy(1,8);
readln(option);
end;
end; {file runner menu}
Procedure FileSheller; {shells out to programs}
var
ProgramName, CmdLine: string;
f : text;
begin
gotoxy(1,8);
Write('File to Run:');
readln(ProgramName);
gotoxy(1,8);
writeln;
Assign(f, 'temp.bat');
Rewrite(f);
Write(f,programname); { Dump text file }
close(f);
quit:=true;
end; {file sheller}
Procedure DisplayFile; {display a text file}
var
S: PathStr;
F:text;
temp:string;
Name: string;
linenumber: integer;
begin
gotoxy(1,8);
write('File to open:');
readln(Name);
gotoxy(1,8);
writeln;
S := FSearch(Name,GetEnv('PATH'));
if S = '' then
begin
gotoxy(1,8);
WriteLn('File not found');
exit;
end;
clrscr;
{ Get file to read from command line }
Assign(f, Name);
Reset(f);
linenumber:=0;
while not Eof(f) do
begin
Readln(f,temp);
Writeln(temp); { Dump text file }
linenumber:=linenumber+1;
if linenumber/20=int(linenumber/20)then readln(temp);
end;
readln(temp);
end; {displaymenu}
Procedure Changedir; {change directory}
var
temp: string;
begin
gotoxy(1,8);
write('Dir:');
readln(temp);
gotoxy(1,8);
writeln;
chdir(temp);
end; {chdir}
Procedure FileRunner; {main file runner procedure}
var
DirInfo: SearchRec; {dir holder}
curpos:integer; {current position}
securpos:integer; {second currentpos}
begin
curoption:='filerunner';
dispstatbox;
gotoxy(1,9);
Writeln('╔Current═Directory═════════════════════════════════════════════════════════════');
FindFirst('*.*', Archive, DirInfo);
curpos:=1;
securpos:=1;
while DosError = 0 do
begin
gotoxy(securpos,curpos+9);
Write('║',dirInfo.Name);
FindNext(DirInfo);
curpos:=curpos+1;
if curpos=15 then
begin
curpos:=0;
securpos:=securpos+15;
end;
end;
repeat
FileRunnerMenu;
dispstatbox;
if option='1' then FileSheller;
if option='2' then DisplayFile;
if option='3' then Changedir;
until option='4';
option:='0';
end; {file runner}
procedure DispScheduleMenu;
begin
gotoxy(1,1);
write('╔═══════Menu═════════════╗');
gotoxy(1,2);
write('║1__Load Schedule ║');
gotoxy(1,3);
write('║2__Display Schedule ║');
gotoxy(1,4);
write('║3__Save Schedule ║');
gotoxy(1,5);
write('║4__Edit Schedule ║');
gotoxy(1,6);
write('║5__Return to main ║');
gotoxy(1,7);
write('╚════════════════════════╝');
option:='0';
while (option<'1') or (option>'5') do
begin
sound(100);
delay(100);
nosound;
gotoxy(1,8);
readln(option);
gotoxy(1,8);
writeln;
end;
end; {displayschedule}
Procedure LoadSchedule;
var
fname :string;
F:text;
counter:integer;
DirInfo: SearchRec;
curpos:integer;
securpos:integer;
begin
gotoxy(1,9);
Writeln('╔Current═Directory═════════════════════════════════════════════════════════════');
FindFirst('*.SCD', Archive, DirInfo);
curpos:=1;
securpos:=1;
while DosError = 0 do
begin
gotoxy(securpos,curpos+9);
Write('║',dirInfo.Name);
FindNext(DirInfo);
curpos:=curpos+1;
if curpos=15 then
begin
curpos:=0;
securpos:=securpos+15;
end;
end;
gotoxy(1,8);
Write('File to open:');
readln(Fname);
gotoxy(1,8);
writeln;
assign(f,fname);
reset(f);
for Counter:=1 to 17 do
readln(f,schedule[Counter]);
close(f);
end; {loadschedule}
Procedure EditSchedule;
var
counter:integer;
clock:integer;
begin
clrscr;
writeln(' ╔══════Schedule═══════════╗');
For counter:=1 to 17 do
begin
clock:=counter+5;
if clock>12 then clock:=clock-12;
write(' ║ ',clock,':00 ');
readln(schedule[counter]);
end;
writeln(' ╚═════════════════════════╝');
end; {edit schedule}
Procedure DispSchedule;
var
counter:integer;
clock:integer;
begin
clrscr;
writeln(' ╔══════Schedule═══════════╗');
For counter:=1 to 17 do
begin
clock:=counter+5;
if clock>12 then clock:=clock-12;
writeln(' ║ ',clock,':00 ',schedule[counter]);
end;
writeln(' ╚═════════════════════════╝');
end; {dispschedule}
Procedure SaveSchedule;
var
fname :string;
F:text;
counter:integer;
DirInfo: SearchRec;
curpos:integer;
securpos:integer;
begin
gotoxy(1,9);
Writeln('╔Current═Directory═════════════════════════════════════════════════════════════');
FindFirst('*.SCD', Archive, DirInfo);
curpos:=1;
securpos:=1;
while DosError = 0 do
begin
gotoxy(securpos,curpos+9);
Write('║',dirInfo.Name);
FindNext(DirInfo);
curpos:=curpos+1;
if curpos=15 then
begin
curpos:=0;
securpos:=securpos+15;
end;
end;
gotoxy(1,8);
Write('File to Save:');
read(Fname);
gotoxy(1,8);
writeln;
assign(f,fname);
rewrite(f);
for Counter:=1 to 17 do
writeln(f,schedule[Counter]);
close(f);
end; {save schedule}
Procedure Scheduler;
begin
curoption:='Scheduler';
dispstatbox;
repeat
Dispschedulemenu;
dispstatbox;
if option='1' then LoadSchedule;
if option='4' then EditSchedule;
if option='2' then DispSchedule;
if option='3' then SaveSchedule;
until option='5';
option:='0';
end; {schedular}
Procedure Databasemenu;
begin
gotoxy(1,1);
write('╔═══════Menu═════════════╗');
gotoxy(1,2);
write('║1__Load Database ║');
gotoxy(1,3);
write('║2__Display Database ║');
gotoxy(1,4);
write('║3__Save Database ║');
gotoxy(1,5);
write('║4__Add Record ║');
gotoxy(1,6);
write('║5__Return to main ║');
gotoxy(1,7);
write('╚════════════════════════╝');
option:='0';
while (option<'1') or (option>'5') do
begin
sound(100);
delay(100);
nosound;
gotoxy(1,8);
readln(option);
gotoxy(1,8);
writeln;
end;
end; {database menu}
Procedure LoadBase; {load datebase}
var
fname :string;
F:text;
counter:integer;
DirInfo: SearchRec;
curpos:integer;
securpos:integer;
cp: string;
begin
gotoxy(1,9);
Writeln('╔Current═Directory═════════════════════════════════════════════════════════════');
FindFirst('*.DBS', Archive, DirInfo);
curpos:=1;
securpos:=1;
while DosError = 0 do
begin
gotoxy(securpos,curpos+9);
Write('║',dirInfo.Name);
FindNext(DirInfo);
curpos:=curpos+1;
if curpos=15 then
begin
curpos:=0;
securpos:=securpos+15;
end;
end;
gotoxy(1,8);
Write('File to open:');
read(Fname);
gotoxy(1,8);
writeln;
assign(f,fname);
reset(f);
while not eof(f) do
begin
readln(f,data[Counter,1],data[counter,2],data[counter,3],data[counter,4]);
curpointer:=curpointer+1;
end;
close(f);
end; {loadbase}
Procedure Dispbase; {display base}
var
counter:integer;
begin
Clrscr;
writeln('╔════════════════════════════════════════════════════════════════╗');
for counter:=1 to curpointer do
writeln('║',data[counter,1],' ',data[counter,2],' ',data[counter,3],' ',data[counter,4]);
writeln('╚════════════════════════════════════════════════════════════════╝');
readln;
end;
Procedure SaveBase; {display save base}
var
fname :string;
F:text;
counter:integer;
DirInfo: SearchRec;
curpos:integer;
securpos:integer;
begin
gotoxy(1,9);
Writeln('╔Current═Directory═════════════════════════════════════════════════════════════');
FindFirst('*.DBS', Archive, DirInfo);
curpos:=1;
securpos:=1;
while DosError = 0 do
begin
gotoxy(securpos,curpos+9);
Write('║',dirInfo.Name);
FindNext(DirInfo);
curpos:=curpos+1;
if curpos=15 then
begin
curpos:=0;
securpos:=securpos+15;
end;
end;
gotoxy(1,8);
Write('File to save:');
read(Fname);
gotoxy(1,8);
writeln;
assign(f,fname);
rewrite(f);
for Counter:=1 to curpointer do
writeln(f,data[Counter,1],data[counter,2],data[counter,3],data[counter,4]);
close(f);
end; {save data base}
Procedure Addbase; {add to base}
Begin
clrscr;
curpointer:=curpointer+1;
gotoxy(27,1);
writeln('╔═════════════════════════════════════════╗');
gotoxy(27,2);
write('║ Record 1:');
readln(data[curpointer,1]);
gotoxy(27,3);
write('║ Record 2:');
readln(data[curpointer,2]);
gotoxy(27,4);
write('║ Record 3:');
readln(data[curpointer,3]);
gotoxy(27,5);
write('║ Record 4:');
readln(data[curpointer,4]);
gotoxy(27,6);
writeln('╚═════════════════════════════════════════╝');
end; {addbase}
Procedure Database; {main database}
begin
clrscr;
curoption:='Database';
dispstatbox;
repeat
dispstatbox;
Databasemenu;
if option='1' then loadbase;
if option='2' then dispbase;
if option='3' then savebase;
if option='4' then addbase;
until option='5';
option:='0';
end; {database}
Procedure Wordproccessor; {a wordproccessor}
var
ProgramName, CmdLine: string;
f : text;
begin
gotoxy(1,8);
Write('File to Proccess:');
readln(ProgramName);
gotoxy(1,8);
writeln;
Assign(f, 'temp.bat');
Rewrite(f);
Write(f,'ne '+programname); { Dump text file }
close(f);
quit:=true;
end; {wordproccessor}
Begin {main part}
initialize;
while quit=false do
begin
clrscr;
dispstatbox;
MainMenu;
if option='1' then FileRunner;
if option='2' then Scheduler;
if option='3' then Database;
if option='4' then Wordproccessor;
curoption:='none';
end;
end. {main part}